package indi.zhifa.study2024.core.common.web.entity.exception;


import lombok.Getter;

public class ServiceException extends RuntimeException {

    @Getter
    private final int code;
    @Getter
    private final String subCode;
    @Getter
    private final String detailMsg;

    public ServiceException(String pSubCode, String pMsg, String pDetailMsg){
        super(pMsg);
        code = 500;
        subCode = null;
        detailMsg = pDetailMsg;
    }

    public ServiceException(String pSubCode, String msg) {
        super(msg);
        this.code = 500;
        subCode = pSubCode;
        detailMsg = msg;
    }

    public ServiceException(String msg) {
        super(msg);
        this.code = 500;
        subCode = null;
        detailMsg = msg;
    }

    public ServiceException(String msg, Throwable e) {
        super(msg, e);
        this.code = 500;
        subCode = null;
        detailMsg = msg;
    }

    public ServiceException(int pErrorCode, String msg) {
        super(msg);
        this.code = pErrorCode;
        subCode = null;
        detailMsg = msg;
    }
    public ServiceException(int pErrorCode, String msg, Throwable e) {
        super(msg, e);
        this.code = pErrorCode;
        subCode = null;
        detailMsg = msg;
    }

}
